import RNFS from 'react-native-fs';
import {uploadImage} from '../api/request'
export const uploadRequest = (uri: string,callback:Function) => {
    RNFS.readFile(uri, "base64").then(content => {
        let paths = uri.split("/");
        let name = paths[paths.length - 1];
        uploadImage(name,content).then(res => {
            callback(res);
        }).catch(err=>{
            callback(err);
            console.log(err);
        })
    })
}
